package per.zzzfwd.query;

import java.util.stream.Stream;

public class ValueBuilder {

    public Value literal(Object value) {
        return new LiteralValue(value);
    }

    public Value list(Object... values) {
        return new CompoundValue(
            Value.ValueConjunction.OR,
            Stream.of(values)
                .map(LiteralValue::new)
                .toArray(Value[]::new)
        );
    }

    public Value and(Value... values) {
        return new CompoundValue(Value.ValueConjunction.AND, values);
    }

    public Value or(Value... values) {
        return new CompoundValue(Value.ValueConjunction.OR, values);
    }
}
